import request from '@/utils/request'

// 查询试卷管理列表
export function listPaperInfo(query) {
  return request({
    url: '/business/paperInfo/list',
    method: 'get',
    params: query
  })
}

// 查询试卷管理详细
export function getPaperInfo(baseId) {
  return request({
    url: '/business/paperInfo/' + baseId,
    method: 'get'
  })
}

// 新增试卷管理
export function addPaperInfo(data) {
  return request({
    url: '/business/paperInfo',
    method: 'post',
    data: data
  })
}

// 修改试卷管理
export function updatePaperInfo(data) {
  return request({
    url: '/business/paperInfo',
    method: 'put',
    data: data
  })
}

// 删除试卷管理
export function delPaperInfo(baseId) {
  return request({
    url: '/business/paperInfo/' + baseId,
    method: 'delete'
  })
}

// 设置试卷生效
export function setMain(query) {
  return request({
    url: '/business/paperInfo/setMain',
    method: 'post',
    params: query
  })
}

// 查询试卷列表
export function paperList(query) {
  return request({
    url: '/business/paperInfo/paperList',
    method: 'get',
    params: query
  })
}

// 预览试卷
export function genPaperByPaperId(baseId) {
  return request({
    url: '/business/paperInfo/genPaperByPaperId?paperId=' + baseId,
    method: 'get'
  })
}
// 课程预览试卷
export function genPaper(baseId, type) {
  return request({
    url: '/business/paperInfo/genPaper?platformId=' + baseId + '&type=' + type,
    method: 'get'
  })
}
